function markup = cal_fun_markup_pscc(eta0,phi,al,d,del,g)
%calibration file recovering regular price markup given eta0,phi

options = optimoptions('fsolve','TolFun',1e-9,'TolX',1e-9,'StepTolerance',1e-9,'Display','final');
u=1;be=.95^(1/12);kap0=1;mu0=1;ent=1-(1+g)*(1-d);

%recover steady state
%def of growth: 1+g=(1-del)*(1+al*eta*shat)
eta_shat=((1+g)/(1-del)-1)/al;%given probability of sale, find steady state eta*shat
%eqm condition: 1+eta*shat=phi/(phi-1)*el/(1-el) where elasticity satisfies el/(1-el)=1/th^eta0 (see proof of Proposition 2)
th_fun=@(eta0_temp) ((phi/(phi-1))/(1+eta_shat))^(1/eta0_temp);%eqm condition yields implied theta given matching function parameter
th=th_fun(eta0);%evaluate th
shat=eta_shat/eta_pscc(th_fun(eta0),mu0,eta0);%evaluate shat

%eqm condition (see equation A.3 in online appendix) pins down corresponding cost
res_fun=@(c) (u-c-be*(1-ent-(1-d)*(1-del))*kap_pscc(shat,kap0,phi)/eta_shat-(1-be+be*ent)*shat*kap_s_pscc(shat,kap0,phi)/eta_shat)/(-kap_n_pscc(shat,kap0,phi)*(1-be*(1-d)*(1-del)*(1-mu_pscc(th,mu0,eta0))))-1;
c_sol=fsolve(res_fun,.5,options);

%corresponding markup
%regular price may be expressed: p^f=u+be*(1-del)*(mu(th)-al)*kap_n(shat)
%markup: p^f/c
markup=(u+be*(1-d)*(1-del)*(mu_pscc(th,mu0,eta0)-al)*kap_n_pscc(shat,kap0,phi))/c_sol;
end
